<!DOCTYPE html>
<%@ include file="/common/taglibs.jsp"%>
<html lang="${pageContext.request.locale.language}">
<head>
    <meta http-equiv="Cache-Control" content="no-store"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="<c:url value="/images/favicon.ico"/>"/>
    <title><decorator:title/> | <fmt:message key="webapp.name"/></title>

    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/lib/bootstrap.min.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/lib/bootstrap-responsive.min.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/style.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/accsetting/accsetting.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/smoothness/jquery-ui-1.10.3.custom.min.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/scripts/lib/languageswitcher/css/polyglot-language-switcher.css'/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/scripts/datepicker/css/datepicker.css'/>" />
    <decorator:head/>

    <script type="text/javascript" src="<c:url value='/scripts/lib/jquery-1.9.1.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/lib/jquery-ui-1.10.3.custom.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/lib/bootstrap.min.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/lib/plugins/jquery.cookie.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/lib/languageswitcher/js/jquery.polyglot.language.switcher.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/lib/knockout-2.3.0.js'/>"></script>
    
    <script type="text/javascript" src="<c:url value='/scripts/jsutil.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/script.js'/>"></script>
    
    <script type="text/javascript" src="<c:url value='/scripts/ajaxhandler.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/localization.js'/>"></script>
    <script src="<c:url value="/scripts/datepicker/js/bootstrap-datepicker.js"/>"></script>
</head>
<body<decorator:getProperty property="body.id" writeEntireProperty="true"/><decorator:getProperty property="body.class" writeEntireProperty="true"/>>
    <c:set var="currentMenu" scope="request"><decorator:getProperty property="meta.menu"/></c:set>
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid">
                <%-- For smartphones and smaller screens --%>
                <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="brand" href="<c:url value='/'/>"><fmt:message key="webapp.name"/></a>
                <%@ include file="/common/menu.jsp" %>
                <c:if test="${pageContext.request.locale.language ne 'en'}">
                    <div id="switchLocale"><a href="<c:url value='/?locale=en'/>">
                        <fmt:message key="webapp.name"/> in English</a>
                    </div>
                </c:if>
                <div class="languageswitcher">
	                <div id="polyglotLanguageSwitcher">
	                	<form action="#">
			                <select id="polyglot-language-options">
								<option id="en" value="en" 
									<c:if test="${sessionScope['javax.servlet.jsp.jstl.fmt.locale.session'] eq 'en'}">
										selected
               						</c:if>>English</option>
								<option id="fr" value="fr"
									<c:if test="${sessionScope['javax.servlet.jsp.jstl.fmt.locale.session'] eq 'fr'}">
										selected
               						</c:if>>Fran&ccedil;ais</option>
								<option id="de" value="de"
									<c:if test="${sessionScope['javax.servlet.jsp.jstl.fmt.locale.session'] eq 'de'}">
										selected
               						</c:if>>Deutsch</option>
								<option id="it" value="it" 
									<c:if test="${sessionScope['javax.servlet.jsp.jstl.fmt.locale.session'] eq 'it'}">
										selected
               						</c:if>>Italiano</option>
								<option id="es" value="es" 
									<c:if test="${sessionScope['javax.servlet.jsp.jstl.fmt.locale.session'] eq 'es'}">
										selected
               						</c:if>>Espa&ntilde;ol</option>
							</select>
						</form>
					</div>
				</div>
            </div>
        </div>
    </div>
	
    <div class="container-fluid">
        <div class="row-fluid">
        	<div class="span1"></div>
        	<div class="span10">
        		<%@ include file="/common/messages.jsp" %>
            	<decorator:body/>
			</div>
			<div class="span1"></div>
            <c:if test="${currentMenu == 'AdminMenu'}">
                <div class="span2">
                <menu:useMenuDisplayer name="Velocity" config="navlistMenu.vm" permissions="rolesAdapter">
                    <menu:displayMenu name="AdminMenu"/>
                </menu:useMenuDisplayer>
                </div>
            </c:if>
        </div>
    </div>

    <div id="footer">
        <span class="left"><fmt:message key="webapp.version"/>
            <c:if test="${pageContext.request.remoteUser != null}">
            | <fmt:message key="user.status"/> ${pageContext.request.remoteUser}
            </c:if>
        </span>
        <span class="right">
            &copy; <fmt:message key="copyright.year"/> <a href="<fmt:message key="company.url"/>"><fmt:message key="company.name"/></a>
        </span>
    </div>

<script type="text/javascript">
$(document).ready(function() {
	(function($){
		var newURL;
		$('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({
			effect: 'fade',
			paramName: 'locale'
		});
	}(jQuery));
});
</script>

<%= (request.getAttribute("scripts") != null) ?  request.getAttribute("scripts") : "" %>


</body>
</html>
